//杨辉三角
#include <stdio.h>

void triangle(int n)
{
    int arr[1000] = {1};
    for(int i = 1; i <= n; i++)
    {
        printf("%-3d ", arr[0]);
        int k = arr[0];
        for(int j = 1; j < i; j++)
        {
            if(j == i - 1)
            {
                arr[j] = 1;
                printf("%-3d ", arr[j]);
            }
            else
            {
                int a = arr[j];
                arr[j] = arr[j] + k;
                k = a;
                printf("%-3d ", arr[j]);
            }
        }
        printf("\n");
    }
}

int main()
{
    int n = 0;
    scanf("%d", &n);
    triangle(n);
    return 0;
}